function check_login_form() {
	login_form = document.forms["login_form"];

	if( login_form == null ) {
		return false;
	}else{
		username = login_form.username;
		password = login_form.password;
		
		if( (username == null) || (password==null) ) {
			return false;
		}else{
			if( username.value.length == 0 ) {
				alert("You need to specify a username to login.");
				return false;
			}
			if( password.value.length == 0) {
				alert("You need to specify a password to login.");
				return false;
			}
			
			var alphanumeric = /^([a-zA-Z0-9_-]+)$/;
			if( !alphanumeric.test(username.value) || !alphanumeric.test(password.value) ) {
				alert("Please use only alphanumeric characters (a-Z,0-9,_,-).");
				return false;
			}
			
			return true;
		}
	}
}